#include <IL/il.h> //devIL library for image loading.
#include <GL/glut.h>
#include <vector>
#include <iostream>
#include <string>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>

#include "objLoader.h"

class modelManager{
protected:
	std::vector<objModel*> model;
	modelManager();
	modelManager(const modelManager&);
	modelManager& operator =(const modelManager&);
private:
	static modelManager* pinstance;
public:
	bool displayModel(std::string id, float xPos=0, float yPos=0, float zPos=0, float xRot=0, float yRot=0, float zRot=0, std::string matName="");
	void freeModel(std::string id);
	bool loadModel(std::string path);
	int getModelFaces(std::string id);
	std::string getMatName(std::string id, int matGroup);
	int getNumMatGroups(std::string id);
	void setModelScale();

	objModel* getmodel(std::string id);
	static modelManager* instance();
	~modelManager();
};

modelManager* MM();
void loadModelDirectory(const boost::filesystem::path & directory, bool recurse_into_subdirs);